package com.eqdd.yiqidian.ui.yiqichuang;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.eqdd.yiqidian.FragmentActivityCustom;
import com.eqdd.yiqidian.R;
import com.eqdd.yiqidian.base.BaseActivity;
import com.eqdd.yiqidian.base.Config;
import com.eqdd.yiqidian.http.HttpConfig;
import com.eqdd.yiqidian.ui.yiqichuang.fragment.ChuangwenFragment;

/**
 * @author吕志豪 .
 * @date 17-12-20  下午2:15.
 * Github :https://github.com/lvzhihao100
 * E-Mail：1030753080@qq.com
 * 简书 :http://www.jianshu.com/u/6e525b929aac
 */

public class ChuangArticleListActivity extends BaseActivity {

    private FragmentActivityCustom dataBinding;
    private ChuangwenFragment fragment;
    private String url;
    private String guid;
    private int isHomePage;
    private int id;

    @Override
    public void initBinding() {
        String title = getIntent().getStringExtra(Config.TITLE);
        url = getIntent().getStringExtra(Config.URL);
        guid = getIntent().getStringExtra(Config.GUID);
        isHomePage = getIntent().getIntExtra(Config.IS_HOMEPAGE,1);
        id = getIntent().getIntExtra(Config.ID, 0);
        dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_fragment);
        initTopTitleBar(View.VISIBLE, title);
    }

    @Override
    public void initData() {
        fragment = new ChuangwenFragment();
        Bundle bundle = new Bundle();
        bundle.putString(Config.URL, url);
        bundle.putString(Config.GUID,guid);
        bundle.putInt(Config.IS_HOMEPAGE, isHomePage);
        bundle.putInt(Config.ID, id);
        fragment.setArguments(bundle);
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.add(R.id.fragment, fragment);
        fragmentTransaction.commit();
    }

    @Override
    public void setView() {

    }
}
